/*
 * Copyright (C) 2016 yixun All Rights Reserved.
 * 
 * CodeTypeEnum.java
 */
package com.yixun.qfbao.model.enums;

import org.apache.commons.lang.StringUtils;

import java.io.Serializable;
/**
 * [文件名称]<br>
 * BaseCodeValue.java<br>
 * <br>
 * [文件描述]<br>
 * 基础编码值 pojo bean<br>
 * <br>
 * [修改记录]<br>
 * 2016-11-23 11:15:27 创建<br>

 * @version 1.00
*/
public enum SMSTypeEnum implements Serializable{
		TYPE_01("SMS001","中介报备",null),
		TYPE_02("SMS002","中介申诉",null),
		TYPE_03("SMS003","案场申诉处理",null),
		TYPE_04("SMS004","预约看房: 超时未来访提醒",null),
		TYPE_05("SMS005","案场: 报备审核",null),
		TYPE_06("SMS006","到访保护期提醒",null),
		TYPE_07("SMS007","案场: 变更交易状态为认筹",null),
		TYPE_08("SMS008","案场: 变更交易状态为认购",null),
		TYPE_09("SMS009","案场: 变更交易状态为签约",null),
		TYPE_10("SMS010","案场: 结佣操作",null),
		TYPE_11("SMS011","案场助手代报备",null),
		TYPE_12("SMS012","重置密码",null),
		TYPE_13("SMS013","注册短信",null),
		TYPE_14("SMS014","验证码",null),
		TYPE_15("SMS015","提醒审核",null),
		TYPE_16("SMS016","到访验真",null),
		TYPE_17("SMS017","公司注册成功",null),
		TYPE_18("SMS018","公司注册失败",null),

		;
		
		private final String no;
		private final String des;
		private final Enum parent;
		
		/**
		 * 私有构造函数
		 * @param no
		 * @param des
		 */
		SMSTypeEnum(String no, String des,Enum parent) {
			this.no = no;
			this.des = des;
			this.parent = parent;
		}

		/**
		 * @return Returns the no.
		 */
		public String getNo() {
			return no;
		}

		/**
		 * @return Returns the des.
		 */
		public String getDes() {
			return des;
		}
		
		/**
		 * @return Returns the parent.
		 */
		public Enum getParent() {
			return parent;
		}

		/**
		 * 通过枚举<code>des</code>获得枚举
		 * 
		 * @param des
		 * @return
		 */
		public static SMSTypeEnum getByDescription(String des) {
			if(StringUtils.isBlank(des)){
				return null;
			}
			for (SMSTypeEnum menum : values()) {
				if (menum.getDes().equals(des)) {
					return menum;
				}
			}
			return null;
		}
		public static SMSTypeEnum getByNo(String no) {
			if(StringUtils.isBlank(no)){
				return null;
			}
			for (SMSTypeEnum menum : values()) {
				if (menum.getNo().equals(no)) {
					return menum;
				}
			}
			return null;
		}
}
